From: Boris Ostrovsky Date: Fri, 23 Jan 2015 16:54:23 +0000 (+0100) Subject: intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL should be initialized to zero X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3860 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=49de0b57b853064d6b3ad1646fafe08b8dcaac98;p=xen.git intel/VPMU: MSR_CORE_PERF_GLOBAL_CTRL should be initialized to zero MSR_CORE_PERF_GLOBAL_CTRL register should be set zero initially. It is up to the guest to set it so that counters are enabled. Signed-off-by: Boris Ostrovsky Acked-by: Kevin Tian Reviewed-by: Dietmar Hahn Tested-by: Dietmar Hahn --- diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c index 8b84079a7b..77931452e6 100644 --- a/xen/arch/x86/hvm/vmx/vpmu_core2.c +++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c @@ -165,14 +165,6 @@ static int core2_get_fixed_pmc_count(void) return MASK_EXTR(eax, PMU_FIXED_NR_MASK); } -static u64 core2_calc_intial_glb_ctrl_msr(void) -{ - int arch_pmc_bits = (1 << arch_pmc_cnt) - 1; - u64 fix_pmc_bits = (1 << fixed_pmc_cnt) - 1; - - return (fix_pmc_bits << 32) | arch_pmc_bits; -} - /* edx bits 5-12: Bit width of fixed-function performance counters */ static int core2_get_bitwidth_fix_count(void) { @@ -373,8 +365,7 @@ static int core2_vpmu_alloc_resource(struct vcpu *v) if ( vmx_add_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL) ) goto out_err; - vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, - core2_calc_intial_glb_ctrl_msr()); + vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, 0); core2_vpmu_cxt = xzalloc_bytes(sizeof(struct core2_vpmu_context) + (arch_pmc_cnt-1)*sizeof(struct arch_msr_pair));